refactor(mqlaunch): make mq-ui.sh the single print_header authority (Step 11a)#48
Conversation
…Step 11a) The launcher redefined print_header after sourcing mq-ui.sh, shadowing the library's version. The two were not cosmetic variants: the launcher override re-forked the dashboard script uncached on every screen, bypassing the dashboard cache model (TTL + mq_dashboard_cache_invalidate) that the rest of the runtime — including the git/release flows and the cache smoke test — already relied on. Remove the launcher override so mq-ui.sh owns print_header outright, and opt the main loop into the dashboard-v7.1 header via a non-exported MQ_USE_DASHBOARD_HEADER=1 (non-exported so it drives this launcher's own print_header without forcing the dashboard header onto child subprocesses, which set the flag themselves). The dead DASHBOARD_V71 variable — used only by the removed override — is deleted. Behavior change (deliberate, chosen with the user): the main-loop header now renders through the cached dashboard path instead of an uncached per-screen fork. Freshness is bounded by MQ_DASHBOARD_CACHE_TTL (default 5s) and invalidated by open_git_menu / open_release_menu, so a commit/stash/tag still refreshes immediately. Escape hatch for investigation: MQ_DASHBOARD_CACHE_TTL=0 restores uncached per-screen rendering. Verified: the dashboard header still renders in the main loop (cached path confirmed populating and reusing within TTL); full selftest suite green, including the dashboard-header-cache contract and headless smoke. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Decision note (of record)This change intentionally unifies Before this change, the launcher-level That made the launcher override a behavioral anomaly: the repo had cache infrastructure, invalidation calls, and cache smoke coverage, but the main loop was still using an uncached path. This PR standardizes the main-loop header on the cached Behavior change
Why this is the preferred behavior
This is a deliberate behavior decision, not a cosmetic cleanup. Risk
Escape hatch (correction to the original draft)
Follow-up
🤖 Recorded via Claude Code |
What
Resolve the
print_headerduplication the git de-layer surfaced (#45). The launcher redefinedprint_headerafter sourcingmq-ui.sh, shadowing the library's version.The two were not cosmetic variants: the launcher override re-forked the dashboard script uncached on every screen, bypassing the dashboard cache model (TTL +
mq_dashboard_cache_invalidate) that the rest of the runtime — the git/release flows, the cache smoke test — already relied on. The override was the anomaly that ignored its own caching infrastructure.mq-ui.shis the soleprint_headerowner.MQ_USE_DASHBOARD_HEADER=1(non-exported so it drives this launcher'sprint_headerwithout forcing the dashboard header onto child subprocesses, which set the flag themselves).DASHBOARD_V71variable (only the removed override used it).Launcher: 1348 → 1347 lines (the override's logic collapses into the single-line opt-in).
Behavior change (deliberate — chosen with the maintainer)
The main-loop header now renders through mq-ui's cached dashboard path instead of an uncached per-screen fork:
MQ_DASHBOARD_CACHE_TTL(default 5s), invalidated byopen_git_menu/open_release_menuso a commit/stash/tag refreshes immediately.MQ_DASHBOARD_CACHE_TTL=0restores uncached, per-screen rendering for investigation.Verification
TTL=0disables) and headless smoke.AUTHORITY_MAPupdated: mq-ui.sh marked soleprint_headerowner.Completes the print_header thread flagged in #45/#47. Part of the
v2.0.0runtime-authority track.🤖 Generated with Claude Code